<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_PUC;?>/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_PUC;?>/css/main.css"/>
    <script type="text/javascript" src="<?php echo ADMIN_PUC;?>/js/libs/modernizr.min.js"></script>
    <script type="text/javascript" src="<?php echo ADMIN_PUC;?>/js/jquery-1.11.3.js"></script>
    
</head>
<body>
<include file="Common/top" />
<div class="container clearfix">
    <include file="Common/left" />
    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">栏目管理</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="/jscss/admin/design/index" method="post">
                    <table class="search-tab">
                        <tr>
                            <th width="120">选择分类:</th>
                            <td>
                                <select name="search-sort" id="">
                                    <option value="">全部</option>
                                    <option value="19">精品界面</option><option value="20">推荐界面</option>
                                </select>
                            </td>
                            <th width="70">关键字:</th>
                            <td><input class="common-text" placeholder="关键字" name="keywords" value="" id="" type="text"></td>
                            <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="result-wrap">
            <form name="myform"  id="myform" method="post">
                <div class="result-title">
                    <div class="result-list">
                        <a href="__CONTROLLER__/add" class="btn btn-primary btn2"><i class="icon-font"></i>新增栏目</a>
                        <a id="batchDel" ><i class="icon-font" ></i><input formaction="__CONTROLLER__/bdel"  class="btn btn-primary btn2" type="submit" value="批量删除"></a>
                        <a id="batchDel" ><i class="icon-font" ></i><input formaction="__CONTROLLER__/cateSort"  class="btn btn-primary btn2" type="submit" value="更新排序"></a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%"><input class="allChoose" id="check"  type="checkbox" ></th>
                            <th>排序</th>
                            <th>ID</th>
                            <th>栏目名称</th>
                            <th>栏目类型</th>
                            <th>缩略图</th>
                            <th>操作</th>
                        </tr>
                        <volist name="cates" id='vo'>
                            <tr>
                                <td class="tc"><input name="ids[]" class='check' value="{$vo.id}" type="checkbox"></td>
                                <td>
                                    <input class="common-input sort-input" name="{$vo.id}" value="{$vo.sort}" type="text">
                                </td>
                                <td>{$vo.id}</td>
                                <td title="发哥经典"><a target="_blank" href="#" title="发哥经典"><?php echo str_repeat('-',$vo['level']*2);?>{$vo.name}</a>
                                </td>
                                <td>
                                <if condition="$vo['type'] eq 1">
                                列表
                                </if>
                                <if condition="$vo['type'] eq 2">
                                单页
                                </if>
                                <if condition="$vo['type'] eq 3">
                                留言
                                </if>
                                <if condition="$vo['type'] eq 4">
                                招聘
                                </if>
                                </td>
                                <td>
                                <if condition="$vo['pic'] neq ''">
                                <img src="__ROOT__/{$vo.pic}" alt="" width="60px"></td>
                                <else/>
                                暂无缩略图
                                </if>
                                <td>
                                    <a class="link-update" href="__CONTROLLER__/edit/id/{$vo.id}">修改</a>
                                    <a class="link-del" href="__CONTROLLER__/del/id/{$vo.id}" onclick="return confirm('确定要删除吗？')">删除</a>
                                </td>
                            </tr>
                        </volist>
                    </table>
                    
                </div>
            </form>
        </div>
    </div>
</div>
<script>
//jqurty点击批量选中全部的checkbox
$('#check').click(function(){
    if($(this).is(':checked')){
        //$(this).attr('checked')  jquery1.6之前没问题，之后不能用了
        $('.check').prop('checked',true);
    }else{
        $('.check').removeAttr('checked');
    }
})

//原生js点击批量选中全部的checkbox
//   function checkall(form) {
//     for(var i = 0;i < form.elements.length; i++) {
//         var e = form.elements[i];
//         if (e.name != 'chkall' && e.disabled != true) {
//             e.checked = form.chkall.checked;
//         }
//     }
// }
</script>
</body>
</html>